1 IDENTIFICATION DIVISION
2 PROGRAM-ID Damped_Oscillator
13 ALIAS COEFFICIENT.1 InitialPosition
14 ALIAS COEFFICIENT.2 InitialSpeed
15 ALIAS COEFFICIENT.3 SpringForce
16 ALIAS COEFFICIENT.4 Damping # linear to speed
17 ALIAS COEFFICIENT.5 Mass # 1 / mass
20 # Colors being used for wiring
26 -1 -> InitialPosition -> -y0 # -initial position of the mass
27 -1 -> InitialSpeed -> y0s’ # y’ is scaled to be within -1..+1
28 +1, y0s’, y0s’ -> Summer.1 -> y0’
29 y’’, IC:y0’ -> INTEGRATOR.1 -> -y’
30 -y’,IC:-y0 -> INTEGRATOR.2 -> y
31 y -> SpringForce -> S*y # springforce times displacement
32 -y’ -> INVERTER.1 -> y’
33 y’ -> Damping -> D*y’ # damping times speed
34 S*y, D*y’ -> SUMMER.2 -> -(Dy’+Sy)
35 -(Dy’+Sy) -> Mass -> -1/m*(Dy’+Sy)=y’’